<template>
  <view>

    <uni-section type="line" :title="'课程名称：' +queryObj.cid+'.'+ queryObj.cname">
    </uni-section>
	
	<uni-section :title="'班级：' + title.class_name" type="circle" :sub-title="'评价ID：' + title.short_id">
	  <template v-slot:right>
	    {{title.year_term}}
	  </template>
	</uni-section>
	
	<view class="stu-table-container">
	  <zb-table :show-header="true" :columns="column" :stripe="true" :fit="true" :border="true" :data="table"
		:fixed="true">
	  </zb-table>
	</view>
    <!--    </uni-section> -->
  </view>
</template>

<script>
  export default {
    data() {
      return {
        // 上个网页传的数据，课程名称id
        queryObj: {
          cid: '',
          cname: ''
        },
        project_id: '',
		column: [{
		    name: 'aproweight_title',
		    label: '标题',
		    fixed: true,
		    width: 100,
		    emptyString: '--'
		  },{
            name: 'aproweight_memo',
            label: '说明'
          },{
            name: 'aproweight_percent',
            label: '权重',
			width: 50
          }
		  ],
		title: [],
        table: [],
		PjList: []
      }
    },
    onLoad(options) {
      // 将页面参数转存到 this.queryObj 对象中
      console.log(options)
      this.queryObj.cid = options.curriulum_id || ''
      this.queryObj.cname = options.curriulum_name || ''
      this.project_id = options.aproject_id || ''
      this.getPj1228Results()
    },
    methods: {
      async getPj1228Results() {
        const {
          data: res
        } =
        await uni.$http.get('?command=pj1228&project=' + this.project_id + '&subject=' + this.queryObj.cid)
        // ?command=pj1228&project=1640654903&subject=05002402
        console.log(res.data)
		//this.PjList = res.data
        this.table = res.data.datas
		this.title = res.data.title
      }
    }
  }
</script>

<style lang="scss">
  .title {
    background-color: #f5f5f5;
  }

  .uni-table :first-child {
    background-color: #EEF6FF;
  }

  .uni-table {
    .uni-table-th {
      vertical-align: middle;
      text-align: center;
    }

    .uni-table-td {
      vertical-align: middle;
      text-align: center;
    }
  }
</style>
